/**
@author		Jong Min, Lee
@date		  01/22/2014
@brief		viewer property parameter

copyright(c) Tae Young Soft. All right reserved. 2014
*/
#include "stdafx.h"
#include "Taurus_Viewer/ViewerPropertyParam.h"

CViewerPropertyParam::CViewerPropertyParam()
{
  m_value.m_T = NULL;
}

CViewerPropertyParam::~CViewerPropertyParam()
{}

DWORD CViewerPropertyParam::getParam(UINT uID, WPARAM wParam, LPARAM lParam)
{
  switch(uID)
  {
  case PARAM_USER_PROFILE_PART:
    {
      CString* pPart = reinterpret_cast<CString*>(wParam);
      *pPart = m_strPart;
    }
    break;

  case PARAM_USER_PROFILE_ITEM:
    {
      CString* pItem = reinterpret_cast<CString*>(wParam);
      *pItem = m_strItem;
    }
    break;

  case PARAM_USER_PROFILE_VALUE:
    {
      CAdapt<MSXML2::IXMLDOMDocument2Ptr>* pValue = (CAdapt<MSXML2::IXMLDOMDocument2Ptr>*)wParam;

      *pValue = m_value;
    }
    break;
  default:
    return ERROR_INVALID_PARAMETER;
  }

  return ERROR_SUCCESS;
}

DWORD CViewerPropertyParam::setParam(UINT uID, WPARAM wParam, LPARAM lParam)
{
  switch (uID)
  {
  case PARAM_USER_PROFILE_PART:
    {
      CString* pPart = reinterpret_cast<CString*>(wParam);
      m_strPart = *pPart;
    }
    break;
  case PARAM_USER_PROFILE_ITEM:
    {
      CString* pItem = reinterpret_cast<CString*>(wParam);
      m_strItem = *pItem;
    }
    break;
  case PARAM_USER_PROFILE_VALUE:
    {
      CAdapt<MSXML2::IXMLDOMDocument2Ptr>* pValue = (CAdapt<MSXML2::IXMLDOMDocument2Ptr>*)wParam;
      m_value = *pValue;
    }
    break;
  default:
    return ERROR_INVALID_PARAMETER;
    break;
  }

  return ERROR_SUCCESS;
}